import { ElMessageBox } from "element-plus"

export default function SysConfirm(
	message: string,
	type: "error" | "warning" | "success" | "info",
) {
	return new Promise((resolve, reject) => {
		ElMessageBox.confirm(message, "系统提示", {
			confirmButtonText: "确定",
			cancelButtonText: "取消",
			type: type,
		})
			.then(() => {
				resolve(true)
			})
			.catch(() => {
				reject(false)
			})
	}).catch(() => {
		return false
	})
}
